package com.zqwh.xtool.converter;

import com.zqwh.xtool.domain.StockVO;
import com.zqwh.xtool.greendao.db.LendOrderDetail;

import java.util.ArrayList;
import java.util.List;

public class LendOrderDetail2StockVOConverter {
    public static StockVO convert(LendOrderDetail detail){
        StockVO stockVO = new StockVO();
        stockVO.setStockId(detail.getStockId());
        stockVO.setDevId(detail.getDevId());
        stockVO.setToolId(detail.getToolId());
        stockVO.setName(detail.getToolName());
        stockVO.setDescription(detail.getToolDesc());
        stockVO.setSpec(detail.getToolSpec());
        stockVO.setHasRFID(detail.getHasRFID());
        stockVO.setEpc(detail.getEpc());
        return stockVO;
    }

    public static List<StockVO> convert(List<LendOrderDetail> detailList){
        ArrayList<StockVO> stockVOList = new ArrayList<>();
        for (LendOrderDetail detail:detailList){
            stockVOList.add(convert(detail));
        }
        return stockVOList;
    }
}
